
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>SSO集成 · 启路框架-使用手册</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-lightbox/css/lightbox.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="example.html" />
    
    
    <link rel="prev" href="config.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    整体介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../ready/ready.html">
            
                <a href="../ready/ready.html">
            
                    
                    技术准备
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../ready/ide.html">
            
                <a href="../ready/ide.html">
            
                    
                    eclipse
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../ready/build.html">
            
                <a href="../ready/build.html">
            
                    
                    本地构建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../ready/nexus.html">
            
                <a href="../ready/nexus.html">
            
                    
                    私服构建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../ready/run.html">
            
                <a href="../ready/run.html">
            
                    
                    运行调试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../ready/specification.html">
            
                <a href="../ready/specification.html">
            
                    
                    结构和分包
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../base/baseReadme.html">
            
                <a href="../base/baseReadme.html">
            
                    
                    基础包介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../base/qiluTask-readme.html">
            
                <a href="../base/qiluTask-readme.html">
            
                    
                    qilu-task
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../base/cache-readme.html">
            
                <a href="../base/cache-readme.html">
            
                    
                    qilucache
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../base/qiluMybatis-readme.html">
            
                <a href="../base/qiluMybatis-readme.html">
            
                    
                    qilu-mybatis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../base/logTrace-readme.html">
            
                <a href="../base/logTrace-readme.html">
            
                    
                    qilu-logTrace
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../base/qilu-export-readme.html">
            
                <a href="../base/qilu-export-readme.html">
            
                    
                    qilu-export
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../base/httpService-readme.html">
            
                <a href="../base/httpService-readme.html">
            
                    
                    qilu-http-service
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../base/validateReadme.html">
            
                <a href="../base/validateReadme.html">
            
                    
                    qilu-validate
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../state/state-course.html">
            
                <a href="../state/state-course.html">
            
                    
                    交易一致的由来
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../state/state-settle.html">
            
                <a href="../state/state-settle.html">
            
                    
                    qilu-state使用说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../state/state-demo.html">
            
                <a href="../state/state-demo.html">
            
                    
                    购买订单的处理示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="backSampleReadme.html">
            
                <a href="backSampleReadme.html">
            
                    
                    后台代码模板
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="security.html">
            
                <a href="security.html">
            
                    
                    安全介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="deploy.html">
            
                <a href="deploy.html">
            
                    
                    部署集成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="config.html">
            
                <a href="config.html">
            
                    
                    spring配置
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.4" data-path="sso.html">
            
                <a href="sso.html">
            
                    
                    SSO集成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="example.html">
            
                <a href="example.html">
            
                    
                    常见代码示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../test/readme.html">
            
                <a href="../test/readme.html">
            
                    
                    关于测试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../test/unitTest.html">
            
                <a href="../test/unitTest.html">
            
                    
                    单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../test/function.html">
            
                <a href="../test/function.html">
            
                    
                    功能测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../test/noFunction.html">
            
                <a href="../test/noFunction.html">
            
                    
                    非功能测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../video/test.html">
            
                <a href="../video/test.html">
            
                    
                    视频
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../video/build.html">
            
                <a href="../video/build.html">
            
                    
                    项目构建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../video/state.html">
            
                <a href="../video/state.html">
            
                    
                    交易一致
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >SSO集成</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="sso&#x7684;&#x96C6;&#x6210;">SSO&#x7684;&#x96C6;&#x6210;</h1>
<h2 id="&#x5E94;&#x7528;&#x96C6;&#x6210;&#x5916;&#x90E8;sso">&#x5E94;&#x7528;&#x96C6;&#x6210;&#x5916;&#x90E8;SSO</h2>
<p>&#x8FD9;&#x79CD;&#x573A;&#x666F;&#x4E3B;&#x8981;&#x662F;&#x6307;,&#x4EA7;&#x54C1;&#x90E8;&#x7F72;&#x5230;&#x5BA2;&#x6237;&#x65B9;,&#x5BA2;&#x6237;&#x65B9;&#x5DF2;&#x7ECF;&#x6709;&#x81EA;&#x5DF1;&#x7684;SSO&#x7CFB;&#x7EDF;&#x4E86;,&#x5BA2;&#x6237;&#x5E0C;&#x671B;&#x5C06;&#x5F53;&#x524D;&#x5E94;&#x7528;&#x7684;&#x767B;&#x5F55;&#x529F;&#x80FD;,&#x548C;&#x81EA;&#x5DF1;&#x7684;SSO&#x5B8C;&#x6210;&#x96C6;&#x6210;,&#x8FD9;&#x6837;&#x4F7F;&#x7528;&#x5F53;&#x524D;&#x5E94;&#x7528;&#x7684;&#x4EBA;,&#x5C31;&#x53EA;&#x8981;&#x8BB0;&#x4E00;&#x5957;&#x7528;&#x6237;&#x540D;&#x5BC6;&#x7801;.</p>
<blockquote>
<p>[!WARNING]
&#x96C6;&#x6210;&#x5916;&#x90E8;SSO,&#x767B;&#x5F55;token&#x7684;&#x5B58;&#x50A8;&#x6A21;&#x5F0F;&#x8BF7;&#x8BBE;&#x7F6E;&#x4E3A;Cookie&#x6A21;&#x5F0F;,&#x8BF7;&#x52FF;&#x4F7F;&#x7528;page&#x6A21;&#x5F0F;</p>
</blockquote>
<pre class="language-"><code>#&#x5C06;&#x767B;&#x5F55;&#x6807;&#x8BC6;(token)&#x5B58;&#x50A8;&#x5728;&#x4EC0;&#x4E48;&#x5730;&#x65B9;,&#x53EF;&#x9009;&#x503C;,cookie:page,&#x9700;&#x8981;&#x4F7F;&#x7528;js,&#x5199;&#x5165;&#x5230;&#x5F53;&#x524D;&#x9875;&#x9762;
#&#x5982;&#x679C;&#x9700;&#x8981;&#x540C;&#x4E00;&#x4E2A;&#x6D4F;&#x89C8;&#x5668;&#x4F7F;&#x7528;&#x591A;&#x4E2A;&#x7528;&#x6237;&#x540C;&#x65F6;&#x767B;&#x5F55;,&#x9700;&#x8981;&#x4F7F;&#x7528;page
sso.token.storeType=cookie
</code></pre><p>&#x4E00;&#x822C;&#x7684;SSO&#x96C6;&#x6210;,&#x90FD;&#x4F1A;&#x8981;&#x6C42;&#x53BB;&#x9664;&#x5F53;&#x524D;&#x7CFB;&#x7EDF;&#x7684;SSOFilter.&#x8BF7;&#x6309;&#x7167;&#x4E0B;&#x9762;&#x7684;&#x6B65;&#x9AA4;&#x8FDB;&#x884C;&#x64CD;&#x4F5C;.</p>
<ol>
<li>&#x5F15;&#x5165;&#x5916;&#x90E8;SSO-client&#x7684;jar&#x5305;,&#x5BF9;SSO-client&#x8FDB;&#x884C;&#x914D;&#x7F6E;.</li>
<li>&#x767B;&#x5F55;&#x9875;&#x9762;&#x7684;&#x8DF3;&#x8F6C;,&#x8BF7;&#x9996;&#x5148;&#x9075;&#x5B88;&#x5916;&#x90E8;SSO-Client&#x7684;&#x89C4;&#x5219;</li>
<li>&#x67E5;&#x770B;&#x5916;&#x90E8;SSO-client&#x7684;&#x56DE;&#x8C03;&#x65B9;&#x5F0F;,&#x4E00;&#x822C;&#x6709;java&#x56DE;&#x8C03;&#x548C;&#x9875;&#x9762;&#x56DE;&#x8C03;2&#x79CD;</li>
<li>&#x4E0D;&#x7BA1;&#x662F;&#x90A3;&#x79CD;&#x56DE;&#x8C03;,&#x6700;&#x7EC8;&#x9700;&#x8981;&#x8C03;&#x7528;&#x5230;loginByPasswdController.tokenApply()&#x7533;&#x8BF7;token&#x548C;loginSuccess()&#x8FDB;&#x884C;&#x767B;&#x5F55;&#x540E;&#x9875;&#x9762;&#x8DF3;&#x8F6C;.</li>
</ol>
<blockquote>
<p>[!WARNING]
&#x5E94;&#x7528;&#x7684;&#x767B;&#x5F55;&#x4FE1;&#x606F;&#x5B58;&#x50A8;&#x5728;threadLocal&#x91CC;&#x9762;,&#x5982;&#x679C;&#x5916;&#x90E8;&#x7684;SSO-client&#x53EA;&#x8D1F;&#x8D23;&#x767B;&#x4E00;&#x6B21;&#x767B;&#x5F55;&#x7684;&#x8DF3;&#x8F6C;,&#x6211;&#x65B9;&#x6280;&#x672F;&#x4EBA;&#x5458;&#x5728;&#x96C6;&#x6210;&#x7684;&#x65F6;&#x5019;,&#x9700;&#x8981;&#x5355;&#x72EC;&#x5199;&#x4E00;&#x4E2A;Filter,&#x9700;&#x8981;&#x6BCF;&#x6B21;&#x8C03;&#x7528;&#x90FD;&#x8C03;&#x7528;SSOClientUtils.getInstance().setCurrent()&#x8FDB;&#x884C;&#x8BBE;&#x7F6E;.</p>
</blockquote>
<h2 id="&#x5176;&#x4ED6;&#x7CFB;&#x7EDF;&#x96C6;&#x6210;&#x672C;&#x7CFB;&#x7EDF;&#x7684;sso">&#x5176;&#x4ED6;&#x7CFB;&#x7EDF;&#x96C6;&#x6210;&#x672C;&#x7CFB;&#x7EDF;&#x7684;SSO</h2>
<ol>
<li>&#x5176;&#x4ED6;&#x7CFB;&#x7EDF;&#x9700;&#x8981;&#x96C6;&#x6210;user-api.jar,&#x5E76;&#x53BB;&#x9664;&#x81EA;&#x5DF1;&#x7684;SSO&#x767B;&#x5F55;&#x673A;&#x5236;.</li>
<li>&#x53C2;&#x8003;spring-security-ssoClient.xml&#x7684;&#x914D;&#x7F6E;,&#x914D;&#x7F6E;SSO.</li>
<li>&#x5728;SSOFilter&#x4E2D;&#x914D;&#x7F6E;&#x5B9E;&#x73B0;callback,&#x6BCF;&#x6B21;&#x9875;&#x9762;&#x8BF7;&#x6C42;&#x90FD;&#x4F1A;&#x56DE;&#x8C03;callback,&#x8BBE;&#x7F6E;&#x5F53;&#x524D;&#x7CFB;&#x7EDF;&#x7684;&#x767B;&#x5F55;&#x6807;&#x8BC6;</li>
<li>&#x5982;&#x679C;&#x5F53;&#x524D;&#x7CFB;&#x7EDF;&#x53EF;&#x4EE5;&#x4FEE;&#x6539;,&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x4F7F;&#x7528;SSOClientUtils&#x7684;&#x65B9;&#x5F0F;,&#x83B7;&#x5F97;&#x5F53;&#x524D;&#x767B;&#x5F55;&#x7528;&#x6237;.</li>
</ol>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>bean</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>tokenService<span class="token punctuation">&quot;</span></span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>TokenService&#x7684;&#x8FDC;&#x7A0B;&#x5B9E;&#x73B0;/&#x672C;&#x5730;&#x5B9E;&#x73B0;,&#x4E3B;&#x8981;&#x662F;&#x9A8C;&#x8BC1;token<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>bean</span><span class="token punctuation">&gt;</span></span>
<span class="token comment">&lt;!-- &#x767B;&#x5F55;&#x4FE1;&#x606F;&#x4F7F;&#x7528;baseCache&#x8FDB;&#x884C;&#x5B58;&#x50A8;,baseCache&#x652F;&#x6301;ehcache,redis,memcached --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>bean</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>storageService<span class="token punctuation">&quot;</span></span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>StorageService&#x7684;&#x672C;&#x5730;&#x5B9E;&#x73B0;<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>bean</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<blockquote>
<p>[!WARNING]</p>
<ol>
<li>&#x96C6;&#x6210;&#x5F53;&#x524D;&#x7CFB;&#x7EDF;&#x7684;&#x767B;&#x5F55;&#x754C;&#x9762;,&#x9700;&#x8981;&#x5B9E;&#x73B0;tokenService&#x63A5;&#x53E3;,&#x8FDC;&#x7A0B;&#x5411;SSO&#x53BB;&#x9A8C;&#x8BC1;token</li>
<li>StorageService&#x662F;token&#x7684;&#x5B58;&#x50A8;&#x673A;&#x5236;,&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x548C;SSO&#x4E00;&#x6837;&#x7684;&#x7F13;&#x5B58;,&#x76F4;&#x63A5;&#x8BFB;&#x53D6;&#x7F13;&#x5B58;&#x7684;&#x5185;&#x5BB9;.</li>
</ol>
</blockquote>
<h2 id="&#x5916;&#x90E8;&#x7CFB;&#x7EDF;&#x6253;&#x5F00;&#x672C;&#x7CFB;&#x7EDF;&#x9875;&#x9762;">&#x5916;&#x90E8;&#x7CFB;&#x7EDF;&#x6253;&#x5F00;&#x672C;&#x7CFB;&#x7EDF;&#x9875;&#x9762;</h2>
<p>&#x672C;&#x7CFB;&#x7EDF;&#x5185;,&#x6700;&#x7EC8;&#x62E6;&#x622A;&#x8BF7;&#x6C42;&#x7684;&#x662F;SSOFilter,SSOFilter&#x5728;&#x62E6;&#x622A;&#x8BF7;&#x6C42;&#x662F;,&#x4F1A;&#x68C0;&#x67E5;&#x4E09;&#x4E2A;&#x4F4D;&#x7F6E;&#x662F;&#x5426;&#x542B;&#x6709;token&#x4FE1;&#x606F;</p>
<ol>
<li>http&#x7684;cookie</li>
<li>http&#x7684;header</li>
<li>request.getParameter()</li>
</ol>
<p>&#x53EA;&#x8981;&#x4E0A;&#x9762;&#x4E09;&#x4E2A;&#x4F4D;&#x7F6E;,&#x90FD;&#x542B;&#x6709;<strong style="color:red">sso.token.name</strong>&#x914D;&#x7F6E;&#x7684;token,&#x5C31;&#x4F1A;&#x90A3;&#x7740;&#x503C;&#x53BB;&#x68C0;&#x67E5;token&#x7684;&#x6709;&#x6548;&#x6027;.</p>
<p>&#x5916;&#x90E8;&#x7CFB;&#x7EDF;&#x6253;&#x5F00;&#x672C;&#x7CFB;&#x7EDF;&#x7684;&#x9875;&#x9762;,&#x6700;&#x7B80;&#x5355;&#x7684;&#x65B9;&#x5F0F;&#x5C31;&#x662F;&#x5728;url&#x540E;&#x9762;&#x52A0;&#x4E0A;token&#x7684;&#x503C;,&#x6BD4;&#x5982;,&#x539F;&#x672C;&#x6253;&#x5F00;&#x7684;url&#x662F;/app1/s/index.do,&#x73B0;&#x5728;&#x8F6C;&#x6362;&#x4E3A;/app1/s/index.do?tokenName=&#x6709;&#x6548;&#x7684;token,&#x8FD9;&#x4E2A;&#x9875;&#x9762;&#x5C31;&#x53EF;&#x4EE5;&#x6B63;&#x5E38;&#x7684;&#x88AB;&#x6253;&#x5F00;.</p>
<p>&#x8BF7;&#x4F7F;&#x7528;loginByPasswd.tokenApply&#x65B9;&#x6CD5;&#x53BB;&#x83B7;&#x5F97;token.&#x53EF;&#x80FD;&#x9700;&#x8981;&#x628A;tokenApply&#x65B9;&#x6CD5;&#x66B4;&#x9732;&#x6210;&#x63A5;&#x53E3;.</p>
<h2 id="&#x96C6;&#x6210;&#x540C;&#x6E90;&#x4EA7;&#x54C1;">&#x96C6;&#x6210;&#x540C;&#x6E90;&#x4EA7;&#x54C1;</h2>
<p>&#x8FD9;&#x8FB9;&#x7684;&#x573A;&#x666F;&#x6307;&#x4EE3;&#x7684;&#x662F;,&#x5BA2;&#x6237;&#x91C7;&#x8D2D;&#x4E86;&#x6211;&#x4EEC;&#x591A;&#x5957;&#x4EA7;&#x54C1;&#x6216;&#x5E73;&#x53F0;,&#x7136;&#x540E;&#x9488;&#x5BF9;&#x8FD9;&#x4E9B;&#x4EA7;&#x54C1;&#x548C;&#x5E73;&#x53F0;,&#x5BA2;&#x6237;&#x5E0C;&#x671B;&#x80FD;&#x4E0D;&#x80FD;&#x5185;&#x90E8;&#x901A;&#x8FC7;&#x540C;&#x4E00;&#x5957;&#x7684;&#x7528;&#x6237;&#x540D;&#x5BC6;&#x7801;&#x8FDB;&#x884C;&#x767B;&#x5F55;&#x64CD;&#x4F5C;.</p>
<p>&#x8BF7;&#x4E00;&#x5B9A;&#x8981;&#x4F7F;&#x7528;&#x4E0B;&#x9762;&#x7684;&#x65B9;&#x5F0F;&#x8FDB;&#x884C;&#x90E8;&#x7F72;.
<a href="images/11.png" data-lightbox="a61895aa-8152-404c-a48c-fc1abaf86261" data-title="&#x540C;&#x6E90;&#x4EA7;&#x54C1;&#x90E8;&#x7F72;"><img src="images/11.png" alt="&#x540C;&#x6E90;&#x4EA7;&#x54C1;&#x90E8;&#x7F72;"></a></p>
<p>&#x4F7F;&#x7528;cookie&#x4F5C;&#x4E3A;token&#x4F20;&#x9012;&#x4ECB;&#x8D28;</p>
<pre class="language-"><code>#&#x5C06;&#x767B;&#x5F55;&#x6807;&#x8BC6;(token)&#x5B58;&#x50A8;&#x5728;&#x4EC0;&#x4E48;&#x5730;&#x65B9;,&#x53EF;&#x9009;&#x503C;,cookie:page,&#x9700;&#x8981;&#x4F7F;&#x7528;js,&#x5199;&#x5165;&#x5230;&#x5F53;&#x524D;&#x9875;&#x9762;
#&#x5982;&#x679C;&#x9700;&#x8981;&#x540C;&#x4E00;&#x4E2A;&#x6D4F;&#x89C8;&#x5668;&#x4F7F;&#x7528;&#x591A;&#x4E2A;&#x7528;&#x6237;&#x540C;&#x65F6;&#x767B;&#x5F55;,&#x9700;&#x8981;&#x4F7F;&#x7528;page
sso.token.storeType=cookie
</code></pre><p>&#x8BF7;&#x4E00;&#x5B9A;&#x4F7F;&#x7528;&#x7F13;&#x5B58;&#x670D;&#x52A1;&#x5668;&#x6765;&#x8FDB;&#x884C;&#x5B58;&#x50A8;&#x64CD;&#x4F5C;,&#x4E0D;&#x80FD;&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x7684;ehcache</p>
<pre class="language-"><code class="lang-xml"><span class="token comment">&lt;!-- &#x767B;&#x5F55;&#x4FE1;&#x606F;&#x4F7F;&#x7528;baseCache&#x8FDB;&#x884C;&#x5B58;&#x50A8;,baseCache&#x652F;&#x6301;ehcache,redis,memcached --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>bean</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>storageService<span class="token punctuation">&quot;</span></span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>com.istock.union.user.service.impl.BaseCacheStorageService<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>defaultExpireTime<span class="token punctuation">&quot;</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>${sso.token.expireTime:1800}<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>property</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>bean</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p>&#x9009;&#x62E9;&#x4E00;&#x4E2A;&#x5E94;&#x7528;&#x4F5C;&#x4E3A;&#x4E3B;&#x8981;&#x767B;&#x5F55;&#x5E94;&#x7528;,&#x5047;&#x8BBE;&#x6211;&#x4EEC;&#x9009;&#x62E9;app1,&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4FEE;&#x6539;app2&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;</p>
<pre class="language-"><code>sso.login.url=/app1/pre/toLogin.do
sso.login.success.url=/app1/s/index.do
</code></pre><p>&#x5728;&#x672C;&#x8EAB;&#x914D;&#x7F6E;&#x4E3A;pre/toLogin.do&#x7684;&#x60C5;&#x51B5;&#x4E0B;,&#x4FEE;&#x6539;&#x4E3A;<strong style="color:red">/app1/</strong>pre/toLogin.do</p>
<p>&#x5176;&#x4ED6;&#x7684;token.name,token.expire&#x8BF7;&#x548C;app1&#x4FDD;&#x6301;&#x4E00;&#x81F4;.</p>
<blockquote>
<p>[!WARNING]
&#x4E0A;&#x8FF0;&#x914D;&#x7F6E;,&#x5B9E;&#x9645;&#x4E0A;&#x662F;&#x628A;&#x4EA7;&#x54C1;&#x5185;&#x90E8;token&#x7684;&#x9A8C;&#x8BC1;&#x6362;&#x6210;&#x4E86;&#x7EDF;&#x4E00;&#x4E2A;&#x7F13;&#x5B58;,&#x800C;token&#x7684;&#x4F20;&#x8F93;&#x7EDF;&#x4E00;&#x4F7F;&#x7528;cookie,&#x5F53;&#x901A;&#x8FC7;&#x540C;&#x4E00;&#x4E2A;NGINX/F5&#x8F6C;&#x53D1;&#x7684;&#x65F6;&#x5019;,cookie&#x53EF;&#x4EE5;&#x65E0;&#x7F1D;&#x7684;&#x4F20;&#x9012;.</p>
</blockquote>
<p>&#x5728;app1&#x7684;SYS_MENU_INFO&#x8868;&#x4E2D;,&#x63D2;&#x5165;app2&#x7684;&#x4E2A;&#x6027;&#x5316;&#x7684;&#x83DC;&#x5355;&#x8D44;&#x6E90;,&#x9700;&#x8981;&#x628A;&#x539F;&#x672C;&#x7684;&#x8D44;&#x6E90;url,&#x589E;&#x52A0;<strong style="color:red">/app2/</strong>&#x7684;&#x524D;&#x7F00;.&#x6BD4;&#x5982;,&#x539F;&#x672C;&#x7684;url&#x4E3A;&quot;s/xxx/aa.do&quot; &#x9700;&#x8981;&#x4FEE;&#x6539;&#x4E3A;<strong style="color:red">/app2/</strong>s/xxx/aa.do</p>
<blockquote>
<p>[!WARNING]&#x7CFB;&#x7EDF;&#x83DC;&#x5355;&#x6709;3&#x79CD;&#x7C7B;&#x578B;</p>
<ol>
<li>&#x5916;&#x90E8;&#x8D44;&#x6E90;,&#x4F7F;&#x7528;http(s)&#x5F00;&#x5934;,&#x751F;&#x6210;&#x7684;&#x83DC;&#x5355;url&#x5C31;&#x662F;&#x914D;&#x7F6E;&#x7684;url,&#x4F8B;&#x5982;,<a href="http://www.baidu.com/a.do" target="_blank">http://www.baidu.com/a.do</a> , &#x751F;&#x6210;&#x7684;url&#x4E3A;<a href="http://www.baidu.com/a.do,&#x8BF7;&#x6C42;&#x7684;url&#x4E3A;http://www.baidu.com/a.do" target="_blank">http://www.baidu.com/a.do,&#x8BF7;&#x6C42;&#x7684;url&#x4E3A;http://www.baidu.com/a.do</a></li>
<li>&#x540C;&#x6E90;url,&#x4F7F;&#x7528;/&#x5F00;&#x5934;,&#x9ED8;&#x8BA4;&#x5DF2;&#x7ECF;&#x643A;&#x5E26;contextPath,&#x751F;&#x6210;&#x7684;url&#x5C31;&#x662F;&#x914D;&#x7F6E;&#x7684;url,&#x6D4F;&#x89C8;&#x5668;&#x4F1A;&#x5E2E;&#x8BF7;&#x6C42;&#x62FC;&#x4E0A;&#x534F;&#x8BAE;,&#x57DF;&#x540D;,&#x7AEF;&#x53E3;&#x53F7;.&#x4F8B;&#x5982;,&#x914D;&#x7F6E;=/app1/s/a.do,&#x751F;&#x6210;&#x7684;url=/app1/s/a.do,&#x8BF7;&#x6C42;&#x7684;url&#x4E3A;<a href="http://&#x6D4F;&#x89C8;&#x5668;ip/app1/s/a.do" target="_blank">http://&#x6D4F;&#x89C8;&#x5668;ip/app1/s/a.do</a></li>
<li>&#x5185;&#x90E8;&#x8D44;&#x6E90;,&#x5176;&#x4ED6;&#x5F00;&#x5934;,&#x751F;&#x6210;&#x83DC;&#x5355;url&#x4F1A;&#x81EA;&#x52A8;&#x62FC;&#x63A5;&#x4E0A;&#x5F53;&#x524D;&#x7CFB;&#x7EDF;&#x7684;contextPath,&#x6D4F;&#x89C8;&#x5668;&#x4F1A;&#x5E2E;&#x8BF7;&#x6C42;&#x62FC;&#x4E0A;&#x534F;&#x8BAE;,&#x57DF;&#x540D;,&#x7AEF;&#x53E3;&#x53F7;,&#x4F8B;&#x5982;,&#x914D;&#x7F6E;&#x7684;url=s/a.do &#x751F;&#x6210;&#x7684;url=/contextPath/s/a.do,&#x8BF7;&#x6C42;&#x7684;url&#x4E3A;<a href="http://&#x6D4F;&#x89C8;&#x5668;ip/contextPath/s/a.do" target="_blank">http://&#x6D4F;&#x89C8;&#x5668;ip/contextPath/s/a.do</a></li>
</ol>
</blockquote>
<p>&#x6700;&#x540E;&#x4FEE;&#x6539;app2&#x7684;&#x6570;&#x636E;&#x6E90;,&#x5C06;SYS<em>&#x5F00;&#x5934;&#x7684;&#x8868;&#x5168;&#x90E8;&#x5220;&#x9664;,&#x628A;app1&#x8868;&#x7684;SYS</em>&#x5F00;&#x5934;&#x7684;&#x8868;,&#x5728;app2&#x7684;&#x6570;&#x636E;&#x5E93;&#x91CC;&#x9762;&#x521B;&#x5EFA;&#x540C;&#x540D;&#x7684;&#x7269;&#x7406;view.</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; senvon 2020 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">Bilibili,&#x5934;&#x6761;&#x53F7;,&#x5FAE;&#x4FE1;&#x53F7;&#xFF1A;&#x8BF7;&#x641C;&#x7D22;  &#x968F;senvon&#x98DE;
2020-07-24 17:29:37
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="config.html" class="navigation navigation-prev " aria-label="Previous page: spring配置">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="example.html" class="navigation navigation-next " aria-label="Next page: 常见代码示例">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"SSO集成","level":"1.5.4","depth":2,"next":{"title":"常见代码示例","level":"1.5.5","depth":2,"path":"backSample/example.md","ref":"backSample/example.md","articles":[]},"previous":{"title":"spring配置","level":"1.5.3","depth":2,"path":"backSample/config.md","ref":"backSample/config.md","articles":[]},"dir":"ltr"},"config":{"plugins":["search-plus","-lunr","-search","tbfed-pagefooter","simple-page-toc","insert-logo","back-to-top-button","toggle-chapters","code","lightbox","copy-code-button","search-pro","emphasize","splitter","mermaid-gb3","-sharing","sharing-plus","prism","-highlight","flexible-alerts","page-toc-button","baidu","pageview-count","bilibili","donate","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy senvon 2020","modify_label":"Bilibili,头条号,微信号：请搜索  随senvon飞"},"prism":{},"emphasize":{},"livereload":{},"simple-page-toc":{"maxDepth":5,"skipFirstH1":true},"splitter":{},"search-pro":{},"bilibili":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"code":{"copyButtons":true},"donate":{"alipay":"images/toutiao.jpg","alipayText":"头条号","button":"联系方式","title":"联系方式","wechat":"images/weixin.PNG","wechatText":"公众号"},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"lightbox":{"jquery":true,"sameUuid":false},"page-toc-button":{"maxTocDepth":5,"minTocSize":2},"back-to-top-button":{},"pageview-count":{},"flexible-alerts":{"danger":{"className":"danger","icon":"fa fa-ban","label":"Attention"},"note":{"className":"info","icon":"fa fa-info-circle","label":"Note"},"style":"flat","tip":{"className":"tip","icon":"fa fa-lightbulb-o","label":"Tip"},"warning":{"className":"warning","icon":"fa fa-exclamation-triangle","label":"Warning"}},"copy-code-button":{},"baidu":{"token":"51550945f89f43511a44753249ab6675"},"sharing":{"qq":true,"all":["douban","qq","qzone","weibo"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":true,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"toggle-chapters":{},"insert-logo":{"style":"background: none; height: 170px; width: 200px","url":"images/logo3.jpg"},"search-plus":{}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"启路框架-使用手册","language":"zh-hans","backplugin":["lightbox"],"gitbook":"*","description":"启路框架-使用手册"},"file":{"path":"backSample/sso.md","mtime":"2020-07-24T09:29:37.511Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-10-19T02:57:27.717Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lightbox/js/lightbox.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-baidu/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    <script src="../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

